Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YouTube] Catch RegexException in subscriber count extractor #1238

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

afontenot
Copy link

@afontenot afontenot commented Nov 2, 2024

When the subscriber count extraction fails to find the Regex pattern, a RegexException is thrown. This is not a fatal error in most cases, for example when downloading the channel page in order to update the user's subscriptions, and so the correct behavior is to return UNKNOWN_SUBSCRIBER_COUNT.

Related issue: TeamNewPipe/NewPipe#11353.

This bug comprises two issues: subscribers cannot be extracted for channels with pronoun tags, and when the RegexException is thrown, channel subscriptions will fail to update because the exception is uncaught. This commit fixes the latter aspect of the issue.

Please see my comment on the issue for suggestions on how the former issue with scraping the pronoun tags might be fixed.

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

Note that the last point above is not applicable to this PR, as the API does not change.

When the subscriber count extraction fails to find the Regex pattern,
a RegexException is thrown. This is not a fatal error in most cases,
for example when downloading the channel page in order to update the
user's subscriptions, and so the correct behavior is to return
UNKNOWN_SUBSCRIBER_COUNT.

Related issue: TeamNewPipe/NewPipe#11353.

This bug comprises two issues: subscribers cannot be extracted for
channels with pronoun tags, and when the RegexException is thrown,
channel subscriptions will fail to update because the exception is
uncaught. This commit fixes the latter aspect of the issue.
@afontenot
Copy link
Author

My comment where I identify the probable source of the parsing issue is here: TeamNewPipe/NewPipe#11353 (comment)

@ShareASmile ShareASmile added bug Issue is related to a bug youtube service, https://www.youtube.com/ labels Nov 3, 2024
@afontenot
Copy link
Author

I had a look at the CI failures and they seem clearly unrelated to my changes. Probably just flaky tests.

@afontenot afontenot changed the title Catch RegexException in subscriber count extractor [YouTube] Catch RegexException in subscriber count extractor Nov 22, 2024
@ShareASmile ShareASmile added the waiting for review Most of the work is done, PR is now ready for a review label Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug waiting for review Most of the work is done, PR is now ready for a review youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants